program q1019;
var
    c, n, i, ans, t: integer;
function gcd(a, b:integer): integer;
begin
    if (b = 0) then
        gcd := a
    else
        gcd := gcd(b, a mod b);
end;

function lcm(a, b:integer): integer;
var
    g: integer;
begin
    g := gcd(a, b);
    lcm := trunc(a / g) * b;
end;
begin
    assign(input, '');
    assign(output, '');
    reset(input);
    rewrite(output);

    readln(c);

    while (c > 0) do
    begin
        read(n);

        read(ans);
        for i:=2 to n do
        begin
            read(t);
            ans := lcm(ans, t);
        end;

        writeln(ans);
        dec(c);
    end;

    close(input);
    close(output);
end.
